package com.intct.hbase.dml;

import com.intct.hbase.HBaseConnection;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Table;

import java.io.IOException;

/**
 * @author gufg
 * @since 2025-11-04 10:53
 *
 * delete '命名空间:表名', 'rowkey', '列族:列限定符'   # 只删除当前版本
 * deleteall '命名空间:表名', 'rowkey'      #删除所有版本
 */
public class DeleteDataImpl extends AbsDml {
    public static void main(String[] args) throws IOException {
       new DeleteDataImpl().start("intct86", "t2");
    }

    @Override
    void execCommand(Table table) throws IOException {
        // api没有deleteall功能，如果删除一行记录，不用增加列族、列限定符信息
        Delete delete = new Delete("1001".getBytes());
//                delete.addColumn("f1".getBytes(), "name".getBytes());

        table.delete(delete);
    }
}
